﻿<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>会员列表</title>
    <meta charset="utf-8" />
    <link href="/themes/default/easyui.css" rel="stylesheet" />
    <link href="/themes/icon.css" rel="stylesheet" />
    <link href="/themes/Site.css" rel="stylesheet" />
    <script src="../jquery-easyui-1.4.3/jquery.min.js"></script>
    <script src="../jquery-easyui-1.4.3/jquery.easyui.min.js"></script>
    <script>
        $(function () {
            $("#btnAdd").click(function () {
                $('#dd').dialog({
                    width: 630, height: 520,
                    left: 400,
                    top: 20,
                })
            .dialog("setTitle", "新增会员")
            .dialog("open");
                $("#frm1").attr("src", "../MessageVIP/VipAdd.html");

            })

            $(function () {
                $("#lock").click(function () {
                    $("#dd").dialog({
                        width: 400,
                        height: 400, left: 400,
                        top: 50,
                    })
                    .dialog("setTitle", "挂失/锁定")
                    .dialog("open")
                    $("#frm1").attr("src", "/MessageVIP/Fourth.html");
                })
            })
            $(function () {
                $("#turnAccount").click(function () {
                    $('#dd').dialog({
                        width: 520, height: 500, left: 400,
                        top: 40,
                    })
                .dialog("setTitle", "会员转账")
                .dialog("open");
                    $("#frm1").attr("src", "../MessageVIP/TurnAccount.html");

                })
                $(function () {
                    $("#turnCard").click(function () {
                        $('#dd').dialog({
                            width: 400, height: 400, left: 400,
                            top: 40,
                        })
                    .dialog("setTitle", "会员换卡")
                    .dialog("open");
                        $("#frm1").attr("src", "../MessageVIP/TurnCard.html");

                    })
                    $("#btnupdate").click(function () {
                        {
                            var row = $("#dg").datagrid("getSelected");
                            if (row != null) {
                                $("#dd").dialog({
                                    width: 630,
                                    height: 520,
                                    left: 400,
                                    top: 20,
                                })
                                           .dialog("setTitle", "编辑会员")
                                           .dialog("open");
                                $("#frm1").attr("src", "../MessageVIP/UpdateVip.html");
                            }
                            else {
                                $.messager.alert("提示", "请选择需要编辑的行", "warning");
                            }
                        }
                    });

                    $("#delete").click(function () {
                        var row = $("#dg").datagrid("getSelected");
                        if (row != null) {
                            $.messager.confirm('温馨提示', '您确定要删除选中的信息吗？', function (r) {

                                if (r) {
                                    alert('确认删除！');
                                }
                            })
                        }
                        else {
                            $.messager.alert("提示", "请选择需要删除的行", "warning");
                        }

                    })
                    //导出弹窗

                    $("#out").click(function () {
                        var row = $("#dg").datagrid("getSelected");
                        if (row != null) {
                            $.messager.confirm('温馨提示', '您确定要导出选中的信息吗？', function (r) {

                                if (r) {
                                    alert('此功能尚未开通，请等待后续开发！');
                                }
                            })
                        }
                        else {
                            $.messager.alert("提示", "请选择需要导出的行", "warning");
                        }

                    })
                    //导入弹窗
                    $("#in").click(function () {
                        var row = $("#dg").datagrid("getSelected");
                        if (row != null) {
                            $.messager.confirm('温馨提示', '您确定要导入选中的信息吗？', function (r) {

                                if (r) {
                                    alert('此功能尚未开通，请等待后续开发！');
                                }
                            })
                        }
                        else {
                            $.messager.alert("提示", "请选择需要删除的行", "warning");
                        }

                    })



                })

            })

        })
    </script>
</head>

<body>
    <div id="dt">
        <div style="border:solid 0px; width:100%;height:50px;">
            <a id="btnAdd" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'">新增</a>
            <a id="btnupdate" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit'">修改</a>
            <a id="delete" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear'">删除</a>
            <a id="lock" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-lock'">挂失/锁定</a>

            <a id="turnAccount" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-large-clipart'">会员转账</a>
            <a id="turnCard" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload'">会员换卡</a>
            <a id="out" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print'">导出Execel</a>
            <a id="in" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-large-smartart'">导入Execel</a>
        </div>
    </div>
    <div>
        <table>
            <tr>
                <td>会员卡号:</td>
                <td><input type="text"  name="txtVipID"/></td>
                <td>会员姓名:</td>
                <td><input type="text" name="txtVipName" /></td>
                <td>会员电话:</td>
                <td><input type="text" name="txtVipphone" /></td>
                <td>会员等级:</td>
                <td>
                    <select style="width:130px">
                        <option></option>
                    </select>
                </td>
                <td>会员卡号:</td>
                <td>
                    <select style="width:130px">
                        <option></option>
                    </select>
                </td>
                <td><a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a></td>
            </tr>
        </table>
    </div>
    <div style="width:1200px">
        <table id="dg" width="1200"></table>
    </div>
    <div id="dd" class="easyui-dialog" title="My Dialog" style="width:400px;height:200px;" data-options="iconCls:'icon-save',resizable:true,modal:true,closed:true">
        <iframe id="frm1" width="98%" height="98%" frameborder="0" scrolling="no"></iframe>
    </div>

    <script>
        $(function () {

            //GridView展示数据
            $('#dg').datagrid({
                fitColumns: true,
                toolbar: "#dt",
                pagination: true,
                singleSelect: true,
                rownumbers: true,
                method: 'get',
                url: '/jquery-easyui-1.4.3/demo/datagrid/datagrid_data1.json',
                columns: [[
                    { field: 'productid', title: '会员卡号', width: 90, align: 'center' },
                    { field: 'productname', title: '会员姓名', width: 90, align: 'center' },
                    { field: 'unitcost', title: '手机号码', width: 90, align: 'center' },
                     { field: 'status', title: '累计消息', width: 90, align: 'center' },
                      { field: 'listprice', title: '会员状态', width: 90, align: 'center' },
                       { field: 'attr1', title: '当前积分', width: 90, align: 'center' },
            { field: 'itemid', title: '性别', width: 90, align: 'center' },
            { field: 'itemid', title: '登记时间', width: 90, align: 'center' },
            { field: 'itemid', title: '当前等级', width: 90, align: 'center' }
                ]]
            });

        });

    </script>
</body>

</html>
